<template>
  <div class="base-company-data">
    <div class="base-company-data__one nowrap">
      <div>
        <span class="title">在职员工</span>
        <span class="num">{{milliFormat(gsyyAll.ygzrs)}} <span class="unit">人</span></span>
      </div>
       <div>
        <span class="title">子公司个数</span>
        <span class="num">{{milliFormat(gsyyAll.zgsgs)}} <span class="unit">个</span></span>
      </div>
      <div>
        <span class="title">分公司个数</span>
        <span class="num">{{milliFormat(gsyyAll.fgsgs)}} <span class="unit">个</span></span>
      </div>
       <div>
        <span class="title">上年税金</span>
        <span class="num">{{milliFormat(cwgsMothAll.sj)}} <span class="unit">元</span></span>
      </div>
      <div>
        <span class="title">中层以上管理干部人数</span>
        <span class="num">{{milliFormat(gsyyAll.zcysglgbrs)}} <span class="unit">人</span></span>
      </div>
    </div>
    <div class="yestoday tit">昨日收费：{{milliFormat(cwgsDayAll.all)}}元</div>
    <div class="base-company-data__two base-company-data__back nowrap">
      <div class="item">
        <span class="title">物业费（元）</span>
        <span class="num">{{milliFormat(cwgsDayAll.wyf)}}</span>
      </div>
      <div class="item">
        <span class="title">能耗费（元）</span>
        <span class="num">{{milliFormat(cwgsDayAll.nhf)}}</span>
      </div>
      <div class="item">
        <span class="title">地下停车管理费（元）</span>
        <span class="num">{{milliFormat(cwgsDayAll.dxtcglf)}}</span>
      </div>
      <div class="item">
        <span class="title">地面停车费（元）</span>
        <span class="num">{{milliFormat(cwgsDayAll.dmtcf)}}</span>
      </div>
      <div class="item">
        <span class="title">代收水电费（元）</span>
        <span class="num">{{milliFormat(cwgsDayAll.dssdf)}}</span>
      </div>
      <div class="item">
        <span class="title">其它收费（元）</span>
        <span class="num">{{milliFormat(cwgsDayAll.qtsf)}}</span>
      </div>
    </div>
    <div class="month tit">{{name}}：{{milliFormat(cwgsMothAll.all)}}元</div>
    <div class="base-company-data__three base-company-data__back nowrap">
      <div class="item">
        <span class="title">物业费（元）</span>
        <span class="num">{{milliFormat(cwgsMothAll.wyf)}}</span>
      </div>
      <div class="item">
        <span class="title">能耗费（元）</span>
        <span class="num">{{milliFormat(cwgsMothAll.nhf)}}</span>
      </div>
      <div class="item">
        <span class="title">地下停车管理费（元）</span>
        <span class="num">{{milliFormat(cwgsMothAll.dxtcglf)}}</span>
      </div>
      <div class="item">
        <span class="title">地面停车费（元）</span>
        <span class="num">{{milliFormat(cwgsMothAll.dmtcf)}}</span>
      </div>
      <div class="item">
        <span class="title">代收水电费（元）</span>
        <span class="num">{{milliFormat(cwgsMothAll.dssdf)}}</span>
      </div>
      <div class="item">
        <span class="title">其它收费（元）</span>
        <span class="num">{{milliFormat(cwgsMothAll.qtsf)}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { milliFormat, formatDate, getFirstDay } from 'js/utils'
export default {
  props: {
   cwgsDayAll: {
     type: Object,
     default: () => {}
   },
   cwgsMothAll: {
     type: Object,
     default: () => {}
   },
   gsyyAll: {
     type: Object,
     default: () => {}
   }
  },
  computed: {
    name() {
      let now = new Date()
      let first = getFirstDay()
      if(formatDate('yyyy-mm-dd', now) === formatDate('yyyy-mm-dd', first) ) {
        return '上月总收费'
      } else if(formatDate('yyyy-mm-dd', new Date()) === formatDate('yyyy-mm-dd', new Date(new Date().getFullYear(), new Date().getMonth(), 2)) ) {
        return '上月总收费'
      } else {
        return '本月总收费'
      }
      return '本月总收费'
    }
  },
  data () {
    return {
      
    }
  },
  methods: {
    milliFormat(num) {
      return milliFormat(num)
    },
  }
}
</script>

<style lang="scss">
.base-company-data {
  // height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin: auto 20px 20px 20px;
  &__one {
    display: flex;
    justify-content: space-around;
    line-height: 40px;
    // white-space: nowrap;
    .title {
      font-size:13px;
      font-family:Microsoft YaHei;
      font-weight:bold;
      color:rgba(124,161,210,1)
    }
    .num {
      font-size: 18px;
      font-family:Microsoft YaHei;
      font-weight:bold;
      color:rgba(69,240,234,1); 
    }
    .unit {
      font-size:13px;
    }
  }
  .tit {
    font-size:18px;
    font-family:FZDaHei-B02;
    font-weight:600;
    display: flex;
    justify-content: flex-end;
    line-height: 40px;
  }
  .yestoday {
    color:rgba(216,156,253,1);
  }
  .month {
    color:rgba(83,237,115,1);
  }
  &__back {
    background:rgba(255,255,255,0.1);
    border-radius:10px;
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    margin-bottom: 20px;
    .item {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .title {
      font-size:13px;
      font-family:Microsoft YaHei;
      font-weight:300;
      font-weight: normal;
      padding-bottom: 10px;
      color:rgba(124,161,210,1);
    }
    .num {
      font-size:20px;
      font-family:FZZhunYuan-M02S;
      font-weight:400;
    }
  }
  &__two {
    .num {
      color:rgba(216,156,253,1);
    }
  }
  &__three {
    .num {
      color:rgba(83,237,115,1);
    }
  }
}
</style>>
